#include <QtGui/QApplication>
#include "ui/MainWindow.h"
#include "core/BlackboardManager.h"
#include <stdio.h>
#include <stdlib.h>

void myMessageOutput(QtMsgType type, const char *msg)
{
    switch (type) {
    case QtDebugMsg:
        fprintf(stderr, "DEBUG: %s\n", msg);
        break;
    case QtWarningMsg:
        fprintf(stderr, "WARN: %s\n", msg);
        break;
    case QtCriticalMsg:
        fprintf(stderr, "CRITICAL: %s\n", msg);
        break;
    case QtFatalMsg:
        fprintf(stderr, "FATAL: %s\n", msg);
        abort();
    }
}

int main(int argc, char *argv[]) {
    qInstallMsgHandler(myMessageOutput);
    QApplication a(argc, argv);

    BlackboardManager blackboardManager;
    MainWindow w(&blackboardManager);
    w.show();

    return a.exec();
}
